<?php
function wordfilter($checkstr,$output){
$iarray = explode(",",$checkstr) ;
foreach($iarray as $i){
$output = eregi_replace(trim($i),' ***** ',$output) ;
}
////////////////////////////////////// Phonetic Filter
foreach($iarray as $i){
//---------------------------------------------------------------- 1
$checkz = explode(" ",$output) ;
foreach($checkz as $c){
//---------------------------------------------------------------- 2
if(metaphone(trim($c))== metaphone(trim($i))){
$output = eregi_replace($c,' ***** ',$output) ;
}
//---------------------------------------------------------------- 2
}
//---------------------------------------------------------------- 1

}
//////////////////////////////////////////////////////
return $output ;
}
?>